package nowcoder.day_48.day12;
import java.util.Scanner;
public class Num2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
            int num = in.nextInt();
            int[]res = new int[2];
        for (int i = 1; i <= num / 2; i++) {
            if (isPrime(i) && isPrime(num - i)){
                res[0] = i;
                res[1] = num - i;
            }
        }
        System.out.println(res[0]);
        System.out.println(res[1]);
    }
    public static boolean isPrime(int num){
        for (int i = 2  ; i <= num - 1; i++) {
            if (num % i == 0)return false;
        }
        return true;
    }
}
